﻿using System.Windows.Input;
using YY.Admin.Core;

namespace YY.Admin.Module
{
    public class TabSource : BindableBase
    {
        /// <summary>
        /// 名称
        /// </summary>
        public virtual string? Name { get; set; }

        /// <summary>
        /// 图标
        /// </summary>
        public virtual string? Icon { get; set; }

        /// <summary>
        /// 图标类型
        /// </summary>
        public virtual IconTypeEnum IconType { get; set; } = IconTypeEnum.AntDesign;

        /// <summary>
        /// 视图
        /// </summary>
        public virtual string? ViewName { get; set; }

        /// <summary>
        /// 视图的导航参数
        /// </summary>
        public INavigationParameters? NavigationParameter { get; set; }

        /// <summary>
        /// 是否选中
        /// </summary>
        private bool _isSelected;

        public virtual bool IsSelected
        {
            get => _isSelected;
            set => SetProperty(ref _isSelected, value);
        }

        /// <summary>
        /// Tab是否允许关闭
        /// </summary>
        private bool _isClosable = true;
        public bool IsClosable
        {
            get => _isClosable;
            set => SetProperty(ref _isClosable, value);
        }

        public ICommand? Command { get; set; }
    }
}
